// 用户相关的mock数据
import { mock, Random } from 'mockjs'

// 获取用户信息
export const getUserInfo = mock({
  'code': 1,
  'msg': '操作成功',
  'data': {
    'userInfo': {
      'id': '@integer(1, 100)',
      'username': '@word(5, 10)',
      'nickname': '@cname',
      'mobile': '1@string("number", 10)',
      'avatar': '@image("100x100", "#4A7BF7", "Avatar")',
      'score': '@integer(0, 10000)',
      'money': '@float(0, 10000, 2, 2)',
      'gender': '@integer(0, 2)',
      'birthday': '@date("yyyy-MM-dd")',
      'bio': '@cparagraph(1)',
      'email': '@email',
      'level': '@integer(1, 10)',
      'vip': '@integer(0, 3)',
      'viptime': '@integer(1600000000, 1630000000)',
      'createtime': '@integer(1600000000, 1630000000)',
      'balance': '@float(0, 10000, 2, 2)'
    }
  }
})

// 更新用户资料
export const updateUserProfile = mock({
  'code': 1,
  'msg': '更新资料成功',
  'data': {
    'userInfo': {
      'id': '@integer(1, 100)',
      'username': '@word(5, 10)',
      'nickname': '@cname',
      'mobile': '1@string("number", 10)',
      'avatar': '@image("100x100", "#4A7BF7", "Avatar")',
      'score': '@integer(0, 10000)',
      'money': '@float(0, 10000, 2, 2)',
      'gender': '@integer(0, 2)',
      'birthday': '@date("yyyy-MM-dd")',
      'bio': '@cparagraph(1)',
      'email': '@email',
      'level': '@integer(1, 10)',
      'vip': '@integer(0, 3)',
      'viptime': '@integer(1600000000, 1630000000)',
      'createtime': '@integer(1600000000, 1630000000)',
      'balance': '@float(0, 10000, 2, 2)'
    }
  }
})

// 退出登录
export const logout = mock({
  'code': 1,
  'msg': '退出成功',
  'data': null
})

// 更新用户头像
export const updateAvatar = mock({
  'code': 1,
  'msg': '更新头像成功',
  'data': {
    'avatar': '@image("100x100", "#4A7BF7", "Avatar")'
  }
})

// 获取指定用户信息
export const getSpecificUserInfo = mock({
  'code': 1,
  'msg': '操作成功',
  'data': {
    'userInfo': {
      'id': '@integer(1, 100)',
      'username': '@word(5, 10)',
      'nickname': '@cname',
      'mobile': '1@string("number", 10)',
      'avatar': '@image("100x100", "#4A7BF7", "Avatar")',
      'score': '@integer(0, 10000)',
      'money': '@float(0, 10000, 2, 2)',
      'gender': '@integer(0, 2)',
      'birthday': '@date("yyyy-MM-dd")',
      'bio': '@cparagraph(1)',
      'email': '@email',
      'level': '@integer(1, 10)',
      'vip': '@integer(0, 3)',
      'viptime': '@integer(1600000000, 1630000000)',
      'createtime': '@integer(1600000000, 1630000000)',
      'balance': '@float(0, 10000, 2, 2)'
    },
    'archivesList': {
      'total': '@integer(10, 50)',
      'per_page': 10,
      'current_page': 1,
      'last_page': '@integer(1, 5)',
      'data|5': [{
        'id': '@id',
        'eid': '@string("lower", 10)',
        'title': '@ctitle(10, 30)',
        'image': '@image("200x150", "#4A7BF7", "CMS")',
        'images': '@image("200x150"),@image("200x150"),@image("200x150")',
        'images_list|3': ['@image("200x150", "#4A7BF7", "CMS")'],
        'channel_id': '@integer(1, 10)',
        'channel': {
          'id': '@integer(1, 10)',
          'name': '@cword(2, 4)',
          'image': '@image("100x100", "#4A7BF7", "CMS")',
          'diyname': '@word(5, 10)',
          'items': '@integer(50, 200)'
        },
        'user_id': '@integer(1, 100)',
        'likes': '@integer(0, 1000)',
        'dislikes': '@integer(0, 100)',
        'comments': '@integer(0, 500)',
        'views': '@integer(100, 10000)',
        'create_date': '@date("yyyy-MM-dd")',
        'createtime': '@integer(1600000000, 1630000000)'
      }]
    }
  }
})

// 获取签到状态
export const getUserSigned = mock({
  'code': 1,
  'msg': '操作成功',
  'data': {
    'signed': '@boolean',
    'successions': '@integer(0, 30)',
    'maxsuccessions': '@integer(30, 100)',
    'total': '@integer(0, 365)'
  }
})